<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: PhyLayerUWBIR Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00175.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">PhyLayerUWBIR Class Reference<div class="ingroups"><a class="el" href="a00524.html">IEEE 802.15.4A - Classes that implement the IEEE 802.15.4A UWB PHY.</a> &#124; <a class="el" href="a00510.html">phyLayer - physical layer modules</a> &#124; <a class="el" href="a00530.html">Power consumption - Classes using/defining power consumption</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="PhyLayerUWBIR" --><!-- doxytag: inherits="PhyLayerBattery" -->
<p>Physical layer that models an Ultra Wideband Impulse Radio wireless communication system.  
 <a href="a00175.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00478_source.html">PhyLayerUWBIR.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for PhyLayerUWBIR:</div>
<div class="dyncontent">
<div class="center"><img src="a00936.png" border="0" usemap="#PhyLayerUWBIR_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for PhyLayerUWBIR:</div>
<div class="dyncontent">
<div class="center"><img src="a00937.png" border="0" usemap="#PhyLayerUWBIR_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a00938.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0bc21103d2912a0732a4e288684666df"></a><!-- doxytag: member="PhyLayerUWBIR::fptr" ref="a0bc21103d2912a0732a4e288684666df" args=")(cComponent *context, t_dynamic_expression_value argv[], int argc)" -->
typedef <br class="typebreak"/>
t_dynamic_expression_value(*&#160;</td><td class="memItemRight" valign="bottom"><b>fptr</b> )(cComponent *context, t_dynamic_expression_value argv[], int argc)</td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a43ea1cb734fb1538cac9e75212c4437c"></a><!-- doxytag: member="PhyLayerUWBIR::finish" ref="a43ea1cb734fb1538cac9e75212c4437c" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a43ea1cb734fb1538cac9e75212c4437c">finish</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Only calls the deciders finish method. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a0bb0cfac6ebb5459b7480bf9df337a3f">initialize</a> (int stage)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">OMNeT++ initialization function.  <a href="#a0bb0cfac6ebb5459b7480bf9df337a3f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a20ac8e3956abe65f59c69d6dcd54ec1d"></a><!-- doxytag: member="PhyLayerUWBIR::setRadioState" ref="a20ac8e3956abe65f59c69d6dcd54ec1d" args="(int rs)" -->
virtual simtime_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a20ac8e3956abe65f59c69d6dcd54ec1d">setRadioState</a> (int rs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Captures radio switches to adjust power consumption. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f49c650fc97f95f8a5835a6e88a7f36"></a><!-- doxytag: member="PhyLayerUWBIR::isRadioInRX" ref="a6f49c650fc97f95f8a5835a6e88a7f36" args="() const " -->
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a6f49c650fc97f95f8a5835a6e88a7f36">isRadioInRX</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the true if the radio is in RX state. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a598bde5841efb7299a2452d55c5c28e3"></a><!-- doxytag: member="PhyLayerUWBIR::ghassemzadehNLOSFunc" ref="a598bde5841efb7299a2452d55c5c28e3" args="(cComponent *, t_dynamic_expression_value argv[] __attribute__((unused)), int)" -->
static t_dynamic_expression_value&#160;</td><td class="memItemRight" valign="bottom"><b>ghassemzadehNLOSFunc</b> (cComponent *, t_dynamic_expression_value argv[] __attribute__((unused)), int)</td></tr>
<tr><td colspan="2"><h2><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a302b0351dfc30fb920bac1e404e44cb6"></a><!-- doxytag: member="PhyLayerUWBIR::ghassemzadehNLOSFPtr" ref="a302b0351dfc30fb920bac1e404e44cb6" args="" -->
static fptr&#160;</td><td class="memItemRight" valign="bottom"><b>ghassemzadehNLOSFPtr</b></td></tr>
<tr><td colspan="2"><h2><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#af67b418135096e35e238c2f135e92702">Activities</a> { <br/>
&#160;&#160;<b>SLEEP_ACCT</b> = 0, 
<b>RX_ACCT</b>, 
<b>TX_ACCT</b>, 
<b>SWITCHING_ACCT</b>, 
<br/>
&#160;&#160;<b>SYNC_ACCT</b>
<br/>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines the power consuming activities (accounts) of the NIC. Should be the same as defined in the decider. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><b>ProtocolIds</b> { <b>IEEE_802154_UWB</b> =  3200
 }</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a580a9a246bc519e8c4f97a5381a8877b"></a><!-- doxytag: member="PhyLayerUWBIR::encapsMsg" ref="a580a9a246bc519e8c4f97a5381a8877b" args="(cPacket *msg)" -->
virtual airframe_ptr_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a580a9a246bc519e8c4f97a5381a8877b">encapsMsg</a> (cPacket *msg)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This function encapsulates messages from the upper layer into an AirFrame and sets all necessary attributes. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00009.html">AnalogueModel</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#ac31e9a6af36256890a441c812643c15d">getAnalogueModelFromName</a> (const std::string &amp;name, <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params) const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> with the specified name.  <a href="#ac31e9a6af36256890a441c812643c15d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00070.html">Decider</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a2ee15cb7866f9a8bcb2f7427229d409a">getDeciderFromName</a> (const std::string &amp;name, <a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;params)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates and returns an instance of the decider with the specified name.  <a href="#a2ee15cb7866f9a8bcb2f7427229d409a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="a00141.html">MiximRadio</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#ad49116e3360ea2cb22d1c495fb14e800">initializeRadio</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes and returns the radio class to use.  <a href="#ad49116e3360ea2cb22d1c495fb14e800"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a56ff67f3b92bc76c59ac536ddaa67dd3"></a><!-- doxytag: member="PhyLayerUWBIR::switchRadioToRX" ref="a56ff67f3b92bc76c59ac536ddaa67dd3" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>switchRadioToRX</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9c45bfb4391b0f8e8f95cbd3d10da9e6"></a><!-- doxytag: member="PhyLayerUWBIR::switchRadioToSync" ref="a9c45bfb4391b0f8e8f95cbd3d10da9e6" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>switchRadioToSync</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a43ef2c382a22da3bcf2445f855a69c6b"></a><!-- doxytag: member="PhyLayerUWBIR::setRadioCurrent" ref="a43ef2c382a22da3bcf2445f855a69c6b" args="(int rs)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a43ef2c382a22da3bcf2445f855a69c6b">setRadioCurrent</a> (int rs)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the actual current drawn for the passed state. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5fe0bd496dfa869ee2646fb0ca76b2da"></a><!-- doxytag: member="PhyLayerUWBIR::setSwitchingCurrent" ref="a5fe0bd496dfa869ee2646fb0ca76b2da" args="(int from, int to)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a5fe0bd496dfa869ee2646fb0ca76b2da">setSwitchingCurrent</a> (int from, int to)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the actual current drawn for switching between the passed states. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a24456da87c4f06ea6f3790447016ecb3"></a><!-- doxytag: member="PhyLayerUWBIR::uwbradio" ref="a24456da87c4f06ea6f3790447016ecb3" args="" -->
<a class="el" href="a00183.html">RadioUWBIR</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>uwbradio</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0ed3efc4d22e27017160fe7663125b9"></a><!-- doxytag: member="PhyLayerUWBIR::syncCurrent" ref="af0ed3efc4d22e27017160fe7663125b9" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#af0ed3efc4d22e27017160fe7663125b9">syncCurrent</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The different currents in mA. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a01b6e33a2d60280bd73ff342f0c3974c"></a><!-- doxytag: member="PhyLayerUWBIR::PhyLayerUWBIR" ref="a01b6e33a2d60280bd73ff342f0c3974c" args="(const PhyLayerUWBIR &amp;)" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#a01b6e33a2d60280bd73ff342f0c3974c">PhyLayerUWBIR</a> (const <a class="el" href="a00175.html">PhyLayerUWBIR</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy constructor is not allowed. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aade3859c00c126335d9b481b78d8a343"></a><!-- doxytag: member="PhyLayerUWBIR::operator=" ref="aade3859c00c126335d9b481b78d8a343" args="(const PhyLayerUWBIR &amp;)" -->
<a class="el" href="a00175.html">PhyLayerUWBIR</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00175.html#aade3859c00c126335d9b481b78d8a343">operator=</a> (const <a class="el" href="a00175.html">PhyLayerUWBIR</a> &amp;)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Assignment operator is not allowed. <br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6584956f6ede8e0f653bad406e0c4c1e"></a><!-- doxytag: member="PhyLayerUWBIR::DeciderUWBIRED" ref="a6584956f6ede8e0f653bad406e0c4c1e" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>DeciderUWBIRED</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Physical layer that models an Ultra Wideband Impulse Radio wireless communication system. </p>
<p>This class loads channel models and deliver frames to an UWB <a class="el" href="a00070.html" title="The basic Decider class.">Decider</a>. It is independent of the modulation technique, as long as the frames are represented using the same approach as in <a class="el" href="a00494_source.html">IEEE802154A.h</a> (Maximum Pulse Amplitude Estimation).</p>
<p>Several channel models are possible: Ghassemzadeh-LOS, Ghassemadeh-NLOS (see <a class="el" href="a00408_source.html">UWBIRStochasticPathlossModel.h</a>) and the IEEE 802.15.4A UWB channel models that use the default power delay profile (see <a class="el" href="a00406_source.html">UWBIRIEEE802154APathlossModel.h</a>).</p>
<p>Currently, an energy detection receiver is modeled in UWBIRED.h. Several synchronization logics have been implemented in derived classes: see <a class="el" href="a00469_source.html">DeciderUWBIREDSync.h</a> and and <a class="el" href="a00471_source.html">DeciderUWBIREDSyncOnAddress.h</a>.</p>
<p>If you want to add a novel receiver (e.g. coherent demodulation), either derive UWBIRED or write your own, then add functionality in this module to load your decider. The same apply for new channel models.</p>
<p>To change the modulation, refer to <a class="el" href="a00438_source.html">UWBIRMac.h</a>, <a class="el" href="a00494_source.html">IEEE802154A.h</a> and UWBIRED.h. To implement optional modes of <a class="el" href="a00099.html" title="This class regroups static methods needed to generate a pulse-level representation of an IEEE 802...">IEEE802154A</a>, refer to <a class="el" href="a00494_source.html">IEEE802154A.h</a>.</p>
<p>Refer to the following publications for more information: [1] An Ultra Wideband Impulse Radio PHY Layer Model for Network Simulation, J. Rousselot, J.-D. Decotignie, Simulation: Transactions of the Society for Computer Simulation, 2010 (to appear). [2] A High-Precision Ultra Wideband Impulse Radio Physical Layer Model for Network Simulation, Jérôme Rousselot, Jean-Dominique Decotignie, Second International Omnet++ Workshop,Simu'TOOLS, Rome, 6 Mar 09. <a href="http://portal.acm.org/citation.cfm?id=1537714">http://portal.acm.org/citation.cfm?id=1537714</a> </p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac31e9a6af36256890a441c812643c15d"></a><!-- doxytag: member="PhyLayerUWBIR::getAnalogueModelFromName" ref="ac31e9a6af36256890a441c812643c15d" args="(const std::string &amp;name, ParameterMap &amp;params) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00009.html">AnalogueModel</a> * PhyLayerUWBIR::getAnalogueModelFromName </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the <a class="el" href="a00009.html" title="Interface for the analogue models of the physical layer.">AnalogueModel</a> with the specified name. </p>
<p>Is able to initialize the following AnalogueModels:</p>
<ul>
<li><a class="el" href="a00226.html" title="This AnalogueModel models implements the Ghassmezadeh stochastic UWB channel models.">UWBIRStochasticPathlossModel</a></li>
<li><a class="el" href="a00222.html" title="This class implements the IEEE 802.15.4A Channel Model[1] in the MiXiM omnet++ modeling framework...">UWBIRIEEE802154APathlossModel</a> </li>
</ul>

<p>Reimplemented from <a class="el" href="a00173.html#aaecc372ab08295d393581440b326922f">PhyLayer</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                                        {
  <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;UWBIRStochasticPathlossModel&quot;</span>)
    <span class="keywordflow">return</span> createAnalogueModel&lt;UWBIRStochasticPathlossModel&gt;(params);

  <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;UWBIRIEEE802154APathlossModel&quot;</span>)
    <span class="keywordflow">return</span> createAnalogueModel&lt;UWBIRIEEE802154APathlossModel&gt;(params);

  <span class="keywordflow">return</span> <a class="code" href="a00175.html#ac31e9a6af36256890a441c812643c15d" title="Creates and returns an instance of the AnalogueModel with the specified name.">PhyLayerBattery::getAnalogueModelFromName</a>(name, params);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a2ee15cb7866f9a8bcb2f7427229d409a"></a><!-- doxytag: member="PhyLayerUWBIR::getDeciderFromName" ref="a2ee15cb7866f9a8bcb2f7427229d409a" args="(const std::string &amp;name, ParameterMap &amp;params)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00070.html">Decider</a> * PhyLayerUWBIR::getDeciderFromName </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="a00079.html#a37995e7f41efc2f95b081653ca01b482">ParameterMap</a> &amp;&#160;</td>
          <td class="paramname"><em>params</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Creates and returns an instance of the decider with the specified name. </p>
<p>Is able to initialize directly the following decider:</p>
<ul>
<li><a class="el" href="a00082.html" title="this Decider models a non-coherent energy-detection receiver">DeciderUWBIREDSyncOnAddress</a></li>
<li><a class="el" href="a00081.html" title="this Decider models a non-coherent energy-detection receiver that synchronizes on the first sync prea...">DeciderUWBIREDSync</a></li>
<li><a class="el" href="a00080.html" title="This class implements a model of an energy detection receiver that demodulates UWB-IR burst position ...">DeciderUWBIRED</a> </li>
</ul>

<p>Reimplemented from <a class="el" href="a00174.html#a9e0540a943e06cb9d7ccc80853c40986">PhyLayerBattery</a>.</p>
<div class="fragment"><pre class="fragment">                                                                                      {
  <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;DeciderUWBIREDSyncOnAddress&quot;</span>) {
      protocolId = IEEE_802154_UWB;
    <span class="keywordflow">return</span> createDecider&lt;DeciderUWBIREDSyncOnAddress&gt;(params);;
  }
  <span class="keywordflow">if</span> (name == <span class="stringliteral">&quot;DeciderUWBIREDSync&quot;</span>) {
      protocolId = IEEE_802154_UWB;
    <span class="keywordflow">return</span> createDecider&lt;DeciderUWBIREDSync&gt;(params);
  }
  <span class="keywordflow">if</span> (name==<span class="stringliteral">&quot;DeciderUWBIRED&quot;</span>) {
      protocolId = IEEE_802154_UWB;
      <span class="keywordflow">return</span> createDecider&lt;DeciderUWBIRED&gt;(params);
  }

  <span class="keywordflow">return</span> <a class="code" href="a00175.html#a2ee15cb7866f9a8bcb2f7427229d409a" title="Creates and returns an instance of the decider with the specified name.">PhyLayerBattery::getDeciderFromName</a>(name, params);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a0bb0cfac6ebb5459b7480bf9df337a3f"></a><!-- doxytag: member="PhyLayerUWBIR::initialize" ref="a0bb0cfac6ebb5459b7480bf9df337a3f" args="(int stage)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PhyLayerUWBIR::initialize </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stage</em></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>OMNeT++ initialization function. </p>
<p>Read simple parameters. Read and parse xml file for decider and analogue models configuration. </p>

<p>Reimplemented from <a class="el" href="a00174.html#a815f95ad9fe89412ff3c5991ec1cfafe">PhyLayerBattery</a>.</p>

<p>References <a class="el" href="a00053.html#ab62c70bb62f89d8d986db102228b63b7">ConnectionManagerAccess::getNic()</a>, <a class="el" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c">BasePhyLayer::radio</a>, and <a class="el" href="a00175.html#af0ed3efc4d22e27017160fe7663125b9">syncCurrent</a>.</p>
<div class="fragment"><pre class="fragment">                                        {
    <a class="code" href="a00175.html#a0bb0cfac6ebb5459b7480bf9df337a3f" title="OMNeT++ initialization function.">PhyLayerBattery::initialize</a>(stage);
  <span class="keywordflow">if</span> (stage == 0) {
    <span class="comment">/* parameters belong to the NIC, not just phy layer</span>
<span class="comment">     *</span>
<span class="comment">     * if/when variable transmit power is supported, txCurrent</span>
<span class="comment">     * should be specified as an xml table of available transmit</span>
<span class="comment">     * power levels and corresponding txCurrent */</span>
    <a class="code" href="a00175.html#af0ed3efc4d22e27017160fe7663125b9" title="The different currents in mA.">syncCurrent</a> = <a class="code" href="a00053.html#ab62c70bb62f89d8d986db102228b63b7" title="Pointer to nic Module.">getNic</a>()-&gt;par( <span class="stringliteral">&quot;syncCurrent&quot;</span> ); <span class="comment">// assume instantaneous transitions between rx and sync</span>
    uwbradio    = <span class="keyword">dynamic_cast&lt;</span><a class="code" href="a00183.html" title="This class extends the basic radio model.">RadioUWBIR</a>*<span class="keyword">&gt;</span>(<a class="code" href="a00029.html#ab2a4c85442ff2436ca7fbe6c424c1b2c" title="The state machine storing the current radio state (TX, RX, SLEEP).">radio</a>);
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="ad49116e3360ea2cb22d1c495fb14e800"></a><!-- doxytag: member="PhyLayerUWBIR::initializeRadio" ref="ad49116e3360ea2cb22d1c495fb14e800" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00141.html">MiximRadio</a> * PhyLayerUWBIR::initializeRadio </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initializes and returns the radio class to use. </p>
<p>Can be overridden by sub-classing phy layers to use their own Radio implementations. </p>

<p>Reimplemented from <a class="el" href="a00029.html#aad75440994998cc89ef7028528197cb7">BasePhyLayer</a>.</p>

<p>References <a class="el" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46">BasePhyLayer::readPar()</a>, <a class="el" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8">BasePhyLayer::recordStats</a>, <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953">MiximRadio::RX</a>, <a class="el" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a">MiximRadio::setSwitchTime()</a>, <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42">MiximRadio::SLEEP</a>, and <a class="el" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d">MiximRadio::TX</a>.</p>
<div class="fragment"><pre class="fragment">                                                 {
  <span class="keywordtype">int</span>    initialRadioState = par(<span class="stringliteral">&quot;initialRadioState&quot;</span>); <span class="comment">//readPar(&quot;initalRadioState&quot;, (int) RadioUWBIR::SYNC);</span>
  <span class="keywordtype">double</span> radioMinAtt       = <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;radioMinAtt&quot;</span>, 1.0);
  <span class="keywordtype">double</span> radioMaxAtt       = <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;radioMaxAtt&quot;</span>, 0.0);

  <a class="code" href="a00183.html" title="This class extends the basic radio model.">RadioUWBIR</a>* uwbradio = RadioUWBIR::createNewUWBIRRadio(<a class="code" href="a00029.html#a71f6c8e91a8f597a5d213b30c64b0cf8" title="Stores if tracking of statistics (esp. cOutvectors) is enabled.">recordStats</a>, initialRadioState, radioMinAtt, radioMaxAtt);

  <span class="comment">// Radio timers</span>
  <span class="comment">// From Sleep mode</span>
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">RadioUWBIR::SLEEP</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">RadioUWBIR::RX</a>,    (hasPar(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>) ? par(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>) : par(<span class="stringliteral">&quot;timeTXToRX&quot;</span>)).doubleValue());
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7afd684ca0a1c84f153dec831272ccde42" title="sleeping">RadioUWBIR::SLEEP</a>, <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">RadioUWBIR::TX</a>,    (hasPar(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>) ? par(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>) : par(<span class="stringliteral">&quot;timeRXToTX&quot;</span>)).doubleValue());

  <span class="comment">// From TX mode</span>
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">RadioUWBIR::TX</a>,    RadioUWBIR::SYNC,  (hasPar(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) ? par(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>)).doubleValue());
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">RadioUWBIR::TX</a>,    <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">RadioUWBIR::RX</a>,    (hasPar(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) ? par(<span class="stringliteral">&quot;timeTXToRX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToRX&quot;</span>)).doubleValue());

  <span class="comment">// From RX mode</span>
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">RadioUWBIR::RX</a>,    <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">RadioUWBIR::TX</a>,    (hasPar(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) ? par(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>)).doubleValue());
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(<a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">RadioUWBIR::RX</a>,    RadioUWBIR::SYNC,  (<a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;timeRXToSYNC&quot;</span>, <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;timeSYNCToRX&quot;</span>, 0.000000001))));
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(RadioUWBIR::SYNC,  <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a4f6c3dfae0f5fccb76b1d42f6ccc785d" title="transmitting state">RadioUWBIR::TX</a>,    (hasPar(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) ? par(<span class="stringliteral">&quot;timeRXToTX&quot;</span>) : par(<span class="stringliteral">&quot;timeSleepToTX&quot;</span>)).doubleValue());

  <span class="comment">// From SYNC mode</span>
  uwbradio-&gt;<a class="code" href="a00141.html#a11843592ab0d8526823ce0478d9eb19a" title="function called by PhyLayer in order to make an entry in the switch times matrix, i...">setSwitchTime</a>(RadioUWBIR::SYNC,  <a class="code" href="a00141.html#a5d69aacb1cf6a57827f07224219fccb7a2c1aea88fe8363141c138da817461953" title="receiving state">RadioUWBIR::RX</a>,    (<a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;timeSYNCToRX&quot;</span>, <a class="code" href="a00029.html#acb6faccca49fc7d6f8604ee7f29b4c46" title="Reads and returns the parameter with the passed name.">readPar</a>(<span class="stringliteral">&quot;timeRXToSYNC&quot;</span>, 0.000000001))));

  <span class="keywordflow">return</span> uwbradio;
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/<a class="el" href="a00478_source.html">PhyLayerUWBIR.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/modules/phy/PhyLayerUWBIR.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00175.html">PhyLayerUWBIR</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:32 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
